<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			var array1 = new Array(7);
			console.log(array1.length);//7
			
			var array2 = new Array(100, 'a', true);
			console.log(array2.length);//3
			console.log(array2[2]);//true
			
			// ArrayList
			// 创建一个空数组，数组长度是可变
			var array = new Array();
			array[0] = '123';
			console.log(array);//['123']
			console.log(array.length);//1
			array[1] = true;
			console.log(array);//['123', true]
			console.log(array.length);//2
			
			// 使用push()和pop()往数组里面放数据和取数据
			var arr = new Array();
			arr.push('zhansgan');
			console.log(arr);//'zhansgan']
			arr.push(false);
			console.log(arr);//['zhansgan', 23]
			arr.push(23);
			console.log(arr);//['zhansgan', false, 23]
			console.log(arr.pop());//23
			console.log(arr);
			console.log(arr.pop());//false
			console.log(arr.pop());//zhangsan
		</script>
	</body>
</html>
